package team.cdlzz.model.servicePojo;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**@
 * @author zw
 * @date 2022-06-28.
 */
@Data
public class Message {
    SocketUser user;

    public Message(SocketUser user, String data, Integer type, List objs) {
        this.user = user;
        this.data = data;
        this.type = type;
        this.objs = objs;
    }

    //分配的临时id
    //发送内容
    String data;
    //发送类型
    Integer type;
    //发送的对象
    List objs = new ArrayList();

    public Message() {
    }


    public static Message loginMessage(SocketUser user,List list){
        Message message = new Message();
        message.setUser(user);
        message.setType(0);
        message.setObjs(list);
        message.setData("加入成功,您分配的id是 === " + user.getUserid());
        return message;
    }

}